@import "./color";

.virtual-scroll-render {
  .ledge-render {
    top: 66px;
    height: 100%;

    virtual-scroller,
    ledge-render {
      height: 100%;
    }
  }
}

.markdown-toc {
  display: flex;
  flex-direction: row;
  width: 100%;
  overflow-y: hidden;

  .right-content {
    width: 85%;
    height: calc(100vh - 66px);
    overflow-y: scroll;

    .ledge-render {
      width: calc(100% - 2em);
      border: solid 1px $border-color;
      background: $white;
      margin: 2em 1em;
    }
  }

  .left-drawer {
    width: 20%;
    min-width: 240px;
    font-size: 16px;
    overflow-y: scroll;
    height: calc(100vh - 66px);
    padding-right: 8px;
    overflow-x: hidden;
    background: $white;
    border-right: solid 1px $border-color;
  }
}

.reporter-page,
.multiple-docs {
  .no-toc-markdown {
    height: calc(100vh - 66px);
    overflow-y: scroll;
    width: 100% !important;
    margin: 0 !important;

    .ledge-render {
      width: calc(100% - 2em);
      border: solid 1px $border-color;
      background: $white;
      margin: 2em 1em;
    }
  }

  .active {
    background-color: $purple;
    color: #fff;
    border-radius: 24px;

    &:hover {
      color: #fff !important;
      background-color: $purple !important;
    }
  }

  .left-drawer {
    ul {
      margin: 0;
      padding: 0 12px;

      li {
        min-height: 44px;
        line-height: 44px;
        font-size: 1.1rem;
        text-align: center;
        display: block;
        margin: 8px 0;

        &:active,
        &:focus {
          outline: 0;
          border: none;
          -moz-outline-style: none;
          border-radius: 24px;
        }

        @extend .noselect;

        &:hover {
          cursor: pointer;
          border-radius: 24px;
          background-color: $hover-grey;
          color: $black;
        }
      }
    }
  }
}

.left-drawer {
  display: flex;
  flex: 1;

  .progress {
    $gap: 10px;
    $line-height: 24px;
    $bullet-radius: 5px;
    $line-thick: 1px;
    $next-color: #666;
    $current-color: #333;
    $prev-color: #333;

    display: inline-flex;
    height: 100%;

    > div {
      display: flex;
      flex-direction: column;
      color: $purple;

      &.left {
        padding-right: $gap;
        padding-left: $gap;
        text-align: right;

        // Line
        div {
          &:last-of-type:after {
            display: none;
          }

          &:after {
            content: "";
            background: fade_out($purple, .9); //rgba(0, 0, 0, 0.6);
            border-radius: 2px;
            position: absolute;
            right: -$gap;
            top: $line-height/2;
            height: 101%;
            width: 1px;
            transform: translateX(50%);
          }
        }
      }

      &.right {
        padding-left: $gap;

        .level_1,
        .level_2,
        .level_3,
        .level_4,
        .level_5 {
          margin: 8px 0;

          a {
            text-decoration: none;
            color: #000;

            &:hover {
              color: $purple;
            }

            &.active {
              color: $purple;
            }
          }
        }

        .level_1 {
          font-weight: 400;
        }

        .level_2 {
          font-weight: 300;
        }

        .level_3,
        .level_4,
        .level_5 {
          font-weight: 100;
        }

        div {
          &.prev {
            &:after {
              transition: none;
            }
          }

          &.active {
            color: $current-color;
            font-weight: bold;

            &:before {
              background: $current-color;
              padding: $bullet-radius * 2;
              transition: all 0.2s .15s cubic-bezier(0.175, 0.885, 0.32, 2);
            }

            &:after {
              height: 0%;
              transition: height .2s ease-out;
            }

            ~ div {
              color: $next-color;

              &:before {
                background: $next-color;
                padding: $bullet-radius * 0.5;
              }

              &:after {
                height: 0%;
                transition: none;
              }
            }
          }

          &.level_1 {
            font-size: 16px;
            padding-left: 12px;
            // Dot
            &:before {
              content: "";
              border-radius: 50%;
              position: absolute;
              top: $line-height/2;
              left: -$gap;
              height: 12px;
              width: 12px;
              border-radius: $line-height/$line-height;
              border: solid 1px $purple;
              background: #fff;
              transform: translateX(-50%) translateY(-50%);
              transition: padding 0.2s ease;
            }

            // Line
            &:after {
              content: "";
              background: $purple;
              border-radius: 2px;
              position: absolute;
              left: -$gap;
              top: 18px;
              height: 101%;
              width: $line-thick;
              transform: translateX(-50%);
              transition: height 0.2s ease;
            }
          }

          .level_2,
          .level_3,
          .level_4,
          .level_5 {
            padding-left: 8px;
          }

          .level_2 {
            font-size: 14px;

            &:before {
              position: relative;
              left: -6px;
              content: '';
              display: inline-block;
              width: 8px;
              height: 8px;
              border-radius: 4px;
              background-color: $purple;
            }
          }

          .level_3, .level_4, .level_5 {
            font-size: 12px;

            &:before {
              height: 0;
              position: relative;
              content: "";
              top: -1px;
              display: inline-block;
              vertical-align: middle;
              border: 1px solid $purple;
              right: 4px;
              width: 4px;
            }
          }
        }
      }

      div {
        flex: 1;
        position: relative;
        cursor: default;

        &:last-of-type {
          flex: 0;
        }
      }
    }
  }
}
